<extend name="Common:common"/>

<block name="main">
fdsf fsd fds

    <script type="text/javascript">
        var $URL = "__APP__/Home/Product/";
        jQuery(function($){
            alert(12312);
            //delete AdminUser
            $(".del").bind('click',function(){
                var $actions = confirm('确认删除该产品吗？删除后不可恢复！');
                var $id = $(this).attr('value');
                var $url = $URL+'delProduct';

                if(!$actions){
                    return false;
                }
                $.ajax({
                    url: $url,
                    type: 'post',
                    dataType: 'json',
                    data:{'id':$id},
                    success:function(response){
                        console.table(response);
                        if(response.errcode == 200 ){
                            alert(response.errmsg);
                            window.location.reload();
                        }else{
                            alert(response.errmsg);
                        }

                    },
                    error:function(){
                        alert('删除失败13123');
                    }
                });
            });
            //status set
            $(".set").bind('click',function(){
                var $id = $(this).attr('value');
                $.ajax({
                    url: $URL+'setStatus',
                    type: 'post',
                    dataType: 'Json',
                    data:{rid:$id},
                    success:function($result){
                        if($result){
                            alert('设置成功');
                            window.location.reload();
                        }else{
                            alert('设置失败');
                        }
                    },
                    error:function(){
                        alert('设置失败');
                    }
                });
            });
        });
    </script>
</block>


